<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>props命名规则</title>
</head>

<body>
  <div id="app">
    <hello-word :my-age='age' :pstr='pstr' :num='12' :bol=true :arr='arr' :array='[tom,jerry,spoke]'
      :obj="{id:1,name:'zhangsan'}"></hello-word>
  </div>
  <script src="./js/vue.js"></script>
  <script>



    Vue.component('hello-word', {

      props: ['myAge', 'pstr', 'num', 'bol', 'arr', 'array', 'obj'],
      data: function () {
        return {
          name: 'Tom',
        }
      },
      template: `
        <div>
          <p>{{name}}</p>  
          <p>{{myAge}}</p>   
          <p>{{pstr}}</p>     
          <span>{{typeof num}}</span><p>{{num}}</p>     

          <span>{{typeof bol}}</span><p>{{bol}}</p>    
          
          <p v-for='(item,index) in arr' :key='index'>{{item}}</p>

          <p>{{typeof array}}</p>  
          <p>{{typeof obj}}</p>  
        </div>
      `
    })
    var vm = new Vue({
      el: '#app',
      data: {
        age: 20,
        pstr: 'string类型',
        arr: ['tom', 'jerry', 'qwer']
      }
    })
  </script>
</body>

</html>